package com.hh.test.convert;

public class CharConvert {

	public static void main(String[] args) {
		printBytes("abcABC".getBytes());
		System.out.println((char) 84);
		System.out.println((char) 84);
		System.out.println(stringToInt("Aa"));
	}

	public static int stringToInt(String str) {
		char[] chars = str.toCharArray();
		int re = 0;
		for (char c : chars) {
			re += c;
		}
		return re;
	}

	public static void printBytes(byte[] bs) {
		for (byte b : bs) {
			System.out.print(b + " ");
		}
		System.out.println();
	}
}
